package com.knife.hospital.controller;

import com.knife.hospital.config.BaseResponse;
import com.knife.hospital.model.department.DepartmentInfoResponse;
import com.knife.hospital.model.department.IdCard;
import com.knife.hospital.service.department.DepartmentService;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;

@Controller
@CrossOrigin
@ResponseBody
@BaseResponse
@RestController
public class DepartmentController {
    @Resource
    private DepartmentService departmentService;

    @GetMapping(value = "api/getDepartmentList")
    public List<IdCard> getDepartmentList(){
        return departmentService.getDepartmentList();
    }

    @GetMapping(value = "api/getDepartmentInfo/{id}")
    public DepartmentInfoResponse getDepartmentInfo(@PathVariable("id") int id){
        return departmentService.getDepartmentInfo(id);
    }
}
